var t = getApp();

Page({
    data: {
        kFootshow: !0
    },
    onLoad: function(t) {
        this.getData();
    },
    tabrshowbtn: function(t) {
        t.detail && this.setData({
            kFootshow: !1
        });
    },
    goreport: function(t) {
        console.log(t);
        var a = t.currentTarget.dataset.id;
        wx.navigateTo({
            url: "/packageE/others/skin_result/skin_result?id=" + a
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        if (!(this.data.current_page >= this.data.last_page)) {
            var t = this.data.page + 1;
            this.setData({
                page: t
            }), this.getMore();
        }
    },
    onShareAppMessage: function() {},
    getData: function() {
        wx.showLoading({
            title: "加载中"
        });
        var a = this, e = t.getNetAddresss("plugin.skin-check.api.skin-check.check-log");
        t._getNetWork({
            url: e,
            data: {
                page: a.data.page
            },
            success: function(t) {
                wx.hideLoading({
                    complete: function(t) {}
                });
                var e = t.data;
                console.log(e), 1 == e.result ? a.setData({
                    member: e.data.member,
                    log: e.data.log.data,
                    last: e.data.last,
                    higher: e.data.higher,
                    current_page: e.data.log.current_page,
                    last_page: e.data.log.last_page
                }) : wx.showToast({
                    icon: "none",
                    title: e.msg,
                    duration: 1500
                });
            },
            fail: function(t) {
                console.log(t), wx.hideLoading({
                    complete: function(t) {}
                });
            }
        });
    },
    getMore: function() {
        wx.showLoading({
            title: "加载中"
        });
        var a = this, e = t.getNetAddresss("plugin.skin-check.api.skin-check.check-log");
        t._getNetWork({
            url: e,
            data: {
                page: a.data.page
            },
            success: function(t) {
                wx.hideLoading({
                    complete: function(t) {}
                });
                var e = t.data;
                console.log(e), 1 == e.result ? a.setData({
                    member: e.data.member,
                    log: a.data.log.concat(e.data.log.data),
                    last: e.data.last,
                    higher: e.data.higher,
                    current_page: e.data.log.current_page,
                    last_page: e.data.log.last_page
                }) : wx.showToast({
                    icon: "none",
                    title: e.msg,
                    duration: 1500
                });
            },
            fail: function(t) {
                console.log(t), wx.hideLoading({
                    complete: function(t) {}
                });
            }
        });
    },
    del: function(a) {
        console.log(a);
        var e = a.currentTarget.dataset.id.id;
        wx.showLoading({
            title: "加载中"
        });
        var o = this, n = t.getNetAddresss("plugin.skin-check.api.skin-check.del-log");
        t._getNetWork({
            url: n,
            data: {
                report_id: e
            },
            success: function(t) {
                wx.hideLoading({
                    complete: function(t) {}
                });
                var a = t.data;
                console.log(a), 1 == a.result ? (o.setData({
                    page: 1
                }), o.getData()) : wx.showToast({
                    icon: "none",
                    title: a.msg,
                    duration: 1500
                });
            },
            fail: function(t) {
                console.log(t), wx.hideLoading({
                    complete: function(t) {}
                });
            }
        });
    }
});